package com.techsoul.common.core.pojo.entity;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.io.Serializable;

/**
 * Entity 支持类
 *
 * @author liuen
 */
public abstract class BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 插入之前执行方法，子类实现
     */
    public abstract void preInsert(String userId);

    /**
     * 更新之前执行方法，子类实现
     */
    public abstract void preUpdate(String userId);

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
    }

}
